package com.bclz.config;

import java.io.IOException;
import java.util.Properties;


/**
 * 
* @ClassName: LoadProperties  
* @Description: Double Check单例 
* @author xuchang  
* @date 2018年9月11日
 */
public class LoadProperties {
	
	private volatile static  Properties prop = null;
	
	private LoadProperties() {
		
		
	}
	
	public static Properties loadHadoopConfig() {
		
		
		if(prop==null) {
			
			synchronized (LoadProperties.class) {
				if(prop==null) {
					prop=new Properties();
					try {
						prop.load(LoadProperties.class.getClassLoader().getResourceAsStream(Constants.HADOOP_PROPERTIES_NAME));
					} catch (IOException e) {
						// TODO Auto-generated catch block
						System.out.println("属性文件载入异常:"+e.getMessage());
					}
				}
			}
			
		}
		return prop;
		
	}
	
}
